package com.cw.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import com.alibaba.excel.annotation.ExcelProperty;

/**
* @author smq
* @since 2021-04-28
*/
@ApiModel(value ="菜单表")
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("SYS_MENU")
public class SysMenu implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "主键")
    @ExcelProperty(value = "ID")
    @TableField("ID")
    private String id;


    @ApiModelProperty(value = "菜单名称")
    @ExcelProperty(value = "NAME")
    @TableField("NAME")
    private String name;

    @ApiModelProperty(value = "前端URL")
    @ExcelProperty(value = "PATH")
    @TableField("PATH")
    private String path;

    @ApiModelProperty(value = "图标")
    @ExcelProperty(value = "ICON")
    @TableField("ICON")
    private String icon;

    @ApiModelProperty(value = "VUE页面")
    @ExcelProperty(value = "COMPONENT")
    @TableField("COMPONENT")
    private String component;

    @ApiModelProperty(value = "排序值")
    @ExcelProperty(value = "SORT")
    @TableField("SORT")
    private Long sort;

    @ApiModelProperty(value = "0-可见，1- 不可见")
    @ExcelProperty(value = "KEEP_ALIVE")
    @TableField("KEEP_ALIVE")
    private String keepAlive;

    @ApiModelProperty(value = "菜单类型 （0菜单 1按钮）")
    @ExcelProperty(value = "TYPE")
    @TableField("TYPE")
    private String type;

    @ApiModelProperty(value = "创建时间")
    @ExcelProperty(value = "CREATE_TIME")
    @TableField("CREATE_TIME")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

    @ApiModelProperty(value = "逻辑删除标记(0--正常 1--删除)")
    @ExcelProperty(value = "DELETE_FLAG")
    @TableField("DELETE_FLAG")
    private String deleteFlag;

    @ApiModelProperty(value = "菜单编码")
    @ExcelProperty(value = "CODE")
    @TableField("CODE")
    private String code;

    @ApiModelProperty(value = "父菜单ID,0最高级")
    @ExcelProperty(value = "PARENT_ID")
    @TableField("PARENT_ID")
    private String parentId;

    @ApiModelProperty("是否有权限 true有 false无 ")
    @TableField(exist = false)
    private boolean authority = false;
    /**
     * 子菜单
     */
    @TableField(exist = false)
    private List<SysMenu> childNodes =new ArrayList<>();
}
